#include <bits/stdc++.h>
using namespace std;

struct State {
  int i, j;
  long long num;
};

int a[4][110];
bool visited[4][110];
int n;
long long ans = 0;

void bfs(int start_i, int start_j) {
  queue<State> q;
  q.push({start_i, start_j, a[start_i][start_j]});
  visited[start_i][start_j] = true;

  while (!q.empty()) {
    State curr = q.front();
    q.pop();
    int nowi = curr.i, nowj = curr.j;
    long long num = curr.num;
    // cout << "nowi: " << nowi << " nowj: " << nowj << " num: " << num << endl;
    visited[nowi][nowj] = true;
    // 如果到达最后一列，更新答案
    if (nowj == n) {
      ans = max(ans, num);
      // continue;
    }

    // 四个方向移动
    if (nowi > 1 && !visited[nowi - 1][nowj]) {
      q.push({nowi - 1, nowj, num * 2 + a[nowi - 1][nowj]});
    }
    if (nowi < 3 && !visited[nowi + 1][nowj]) {
      q.push({nowi + 1, nowj, num * 2 + a[nowi + 1][nowj]});
    }
    if (nowi == 2 && nowj > 1 && !visited[nowi][nowj - 1]) {
      q.push({nowi, nowj - 1, num * 2 + a[nowi][nowj - 1]});
    }
    if (nowj < n && !visited[nowi][nowj + 1]) {
      q.push({nowi, nowj + 1, num * 2 + a[nowi][nowj + 1]});
    }
    // visited[nowi][nowj] = false; // 回溯，标记为未访问
  }
}

int main() {
  cin >> n;
  for (int i = 1; i <= 3; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> a[i][j];
    }
  }

  // 从第一列的三个位置开始
  for (int i = 1; i <= 3; i++) {
    if (a[i][1] == 1) {
      memset(visited, false, sizeof(visited));
      bfs(i, 1);
    }
  }

  cout << ans;
  return 0;
}